$(function(){
	
	$('body').append(
	'<div class="modal fade bs-example-modal-sm" id="alertDialog" tabindex="-1" role="dialog" aria-labelledby="alertDialogLabel">'+
	'<div class="modal-dialog modal-sm" role="document">'+
	'	<div class="modal-content">'+
	'		<div class="modal-header">'+
	'			<button type="button" class="close" data-dismiss="modal" aria-label="Close">'+
	'				<span aria-hidden="true">&times;</span>'+
	'			</button>'+
	'			<h5 class="modal-title" id="alertDialogLabel">'+
	'				<i class="glyphicon glyphicon-exclamation-sign"></i> 操作提示'+
	'			</h5>'+
	'		</div>'+
	'		<div class="modal-body" id="alertDialogMessage"></div>'+
	'	</div>'+
	'</div>'+
	'</div>'
	);
	
});	

function alert1(message){
	$('#alertDialogMessage').text(message);
	$('#alertDialog').modal('show');
}

function alert(message) {
	if ($("#alert").length > 0) {
		clearTimeout(alertTimeout);
		$('#alert').remove();
	}
	$('body').prepend(
		'<div style="position:fixed;z-index:9999;width:100%;" class="alert alert-danger" id="alert">' +
		message +
		'</div>'
	);
	alertTimeout = setTimeout(closeAlert, 3000);
}
function closeAlert() {
	$('#alert').fadeOut();
}